#ifndef _BSP_DETECT_AT8236_H
#define _BSP_DETECT_AT8236_H

#include <stdint.h>

#define WHEEL_COUNT 4               // 轮子数量
#define TIM_LOOP_MARK 10000         // 重载计数器用于麦轮,起始基准值 方便计算倒转时不会反向0~65535溢出
#define ENCODER_COUNTS_PER_REV 390  // 编码器每圈计数 设置每圈触发390个脉冲

typedef struct {
    int32_t count;  //脉冲计数器
    int32_t speed;
    uint32_t tick_time;//取样时间
} WheelSpeed_t;

typedef struct {
    uint8_t wheelCount; //轮子数量
    WheelSpeed_t wheelSpeeds[WHEEL_COUNT];//四轮状态
} BSP_Wheel_Sensor_HandleTypeDef;

void BSP_Wheel_Detect_Init(void);
void BSP_Wheel_Detect_Loop(void);

extern   BSP_Wheel_Sensor_HandleTypeDef hws; 

#endif